package com.yanqu.road.server.manger.relatives.task;

import com.yanqu.road.server.manger.relatives.RelativesMgr;
import com.yanqu.road.utils.executor.GeneralTask;

public class AddCrossLetterNumTask extends GeneralTask {


    long userId;

    long relativesId;

    long relativesServerId;

    String params;

    int writeNum;


    public AddCrossLetterNumTask(long userId, long relativesId, long relativesServerId, String params, int writeNum) {
        this.userId = userId;
        this.relativesId = relativesId;
        this.relativesServerId = relativesServerId;
        this.params = params;
        this.writeNum = writeNum;
    }

    @Override
    public void doRun() {
        boolean load = RelativesMgr.isLoadUserRelatives(userId);
        if(!load){
            RelativesMgr.loadRelativesInfo(userId);
        }

        RelativesMgr.addCrossLetterNum(userId, relativesId, writeNum);
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public long getRelativesId() {
        return relativesId;
    }

    public void setRelativesId(long relativesId) {
        this.relativesId = relativesId;
    }

    public long getRelativesServerId() {
        return relativesServerId;
    }

    public void setRelativesServerId(long relativesServerId) {
        this.relativesServerId = relativesServerId;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }
}
